<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

/**
 * Get "now" time
 *
 * Returns time() or its GMT equivalent based on the config file preference
 *
 * @access	public
 * @return	integer
 */
if ( ! function_exists('check_controller')){
    function check_controller($vars=array())
    {
        if( ! is_array($vars)){
            return FALSE;
        }
        
        
    }
}

/**
 * Get "now" time
 *
 * Returns time() or its GMT equivalent based on the config file preference
 *
 * @access	public
 * @return	integer
 */
if ( ! function_exists('validate_class_name')){
    function validate_class_name($str='')
    {
        $pattern = '/^([a-zA-Z_])([a-zA-Z0-9_]+)$/'; // 
	if(preg_match_all($pattern,$str,$regs)){
	    return TRUE;
	}
        return FALSE;
    }
}

/**
 * Get "now" time
 *
 * Returns time() or its GMT equivalent based on the config file preference
 *
 * @access	public
 * @return	integer
 */
if ( ! function_exists('convert')){
    function convert($size) {
        $unit=array('b','kb','mb','gb','tb','pb');
        return @round($size/pow(1024,($i=floor(log($size,1024)))),2).' '.$unit[$i];
    }
}

/**
 * Get "now" time
 *
 * Returns time() or its GMT equivalent based on the config file preference
 *
 * @access	public
 * @return	integer
 */
if ( ! function_exists('getmicrotime')){
    function getmicrotime($t) {
        list($usec, $sec) = explode(" ",$t);
	return ((float)$usec + (float)$sec);
    }
}

/**
 * Get "now" time
 *
 * Returns time() or its GMT equivalent based on the config file preference
 *
 * @access	public
 * @return	integer
 */
if ( ! function_exists('get_instance')){
    function &get_instance(){
        return DL_Controller::get_instance();
    }
}

if ( ! function_exists('log_message'))
{
    function log_message($level = 'error', $message, $php_error = FALSE)
    {
	echo "$level : $message";
	exit;
    }
}
/* End of file dl_helpers.php */
/* Location: ./core/dl_helpers.php */